﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Chess
{
    public class Moves:IEnumerable
    {
        public ArrayList moves = new ArrayList();


        public IEnumerator GetEnumerator()
        {
            return moves.GetEnumerator();
        }
        
        public Move Item(int index)
        {
            return (Move)moves[index];
        }

        public void Add(Move move)
        {
            moves.Add(move);
        }
        
        public void Add(Piece Piece, Square From, Square To, Piece piecePlay)
        {
            moves.Add(new Move(Piece,From,To,piecePlay));
        }
        public int MoveNumber
        {
            get { return moves.Count; }
        }

        public void LastMove()
        {
            moves.RemoveAt(moves.Count - 1);
        }

        public void Clear()
        {
            moves.Clear();
        }
    }
}
